package softOffer;

import java.util.Scanner;

public class Question5 {

	public static void main(String[] args) {
		Question5 question = new Question5();
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		System.out.println(question.NumberOf1(n));
	}

	private int NumberOf1(int n) {
		int count = 0;
		while (n != 0) {
			count++;
			n &= n - 1;

		}
		return count;
	}
}
